package com.aspire.boc.mms.wmf.util;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

public class Utils {
	
	/**
	 * 去掉重复
	 * @Title: removeDuplicateWithOrder 
	 * @Description: TODO(这里用一句话描述这个方法的作用) 
	 * @param list
	 * @return
	 */
	public static <T> List<T> removeDuplicateWithOrder(List<T> list) {
        Set<T> set = new HashSet<T>();
        List<T> newList = new ArrayList<T>();
        for (Iterator<T> iter = list.iterator(); iter.hasNext();) {
            T element = iter.next();
            if (set.add(element))
                newList.add(element);
        }
        return newList;
    }

}
